import { createStore } from 'vuex'
import category from './modules/category'
import user from './modules/user'
import createPersistedState from 'vuex-persistedstate'
export default createStore({
  // 严格模式
  strict: process.env.NODE_ENV === 'development',
  modules: {
    category,
    user
  },
  // 指定vuex的插件
  plugins: [
    createPersistedState({
      // 指定需要缓存的模块
      paths: ['user'],
      key: 'rabbit-shhm-83',
      // 默认就是localStorage
      storage: localStorage
    })
  ]
})
